<!--
 * @Author: [kangjie]
 * @Date: 2022-04-08 15:28:01
 * @LastEditors: [kangjie]
 * @LastEditTime: 2022-04-08 15:38:20
 * @Description: 
-->
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="./js/axios-0.20.0.js"></script>
  <script src="./js/qs-6.9.4.js"></script>
</head>

<body>
  <script>
    let interceptors = axios.interceptors.response.use(response => {
      // Do something before response is sent
      console.log(response, 'axios的响应数据');
      let res = {
        ...response,
        data: response.data.data,
        status: response.data.status
      }
      return res;
    }, error => {
      // Do something with response error
      return Promise.reject(error);
    });
    axios.get(
      "http://121.199.0.35:8888/index/carousel/findAll",
    ).then(res => {
      console.log(res.data, '后台的数据');
    });
    setTimeout(() => {
      axios.interceptors.response.eject(interceptors);
      axios.get(
        "http://121.199.0.35:8888/index/carousel/findAll",
      ).then(res => {
        console.log(res.data, '后台的数据');
      });
    }, 3000)
  </script>
</body>

</html>